<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.10"/>
<title>ESP8266_RTOS_SDK: Sniffer APIs</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">ESP8266_RTOS_SDK
   &#160;<span id="projectnumber">v1.4.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.10 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Sniffer APIs<div class="ingroups"><a class="el" href="group__WiFi__APIs.html">WiFi Related APIs</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>WiFi sniffer APIs.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gaec780f59bcc8f01c0a4098da86bea999"><td class="memItemLeft" align="right" valign="top">typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#gaec780f59bcc8f01c0a4098da86bea999">wifi_promiscuous_cb_t</a>) (uint8 *buf, uint16 len)</td></tr>
<tr class="memdesc:gaec780f59bcc8f01c0a4098da86bea999"><td class="mdescLeft">&#160;</td><td class="mdescRight">The RX callback function in the promiscuous mode.  <a href="#gaec780f59bcc8f01c0a4098da86bea999">More...</a><br /></td></tr>
<tr class="separator:gaec780f59bcc8f01c0a4098da86bea999"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga2baed988e772a0ba9107984b4ef5e7a2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#ga2baed988e772a0ba9107984b4ef5e7a2">wifi_set_promiscuous_rx_cb</a> (<a class="el" href="group__WiFi__Sniffer__APIs.html#gaec780f59bcc8f01c0a4098da86bea999">wifi_promiscuous_cb_t</a> cb)</td></tr>
<tr class="memdesc:ga2baed988e772a0ba9107984b4ef5e7a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register the RX callback function in the promiscuous mode.  <a href="#ga2baed988e772a0ba9107984b4ef5e7a2">More...</a><br /></td></tr>
<tr class="separator:ga2baed988e772a0ba9107984b4ef5e7a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga152796dafaf3baffe84e1a45ff05b5e0"><td class="memItemLeft" align="right" valign="top">uint8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#ga152796dafaf3baffe84e1a45ff05b5e0">wifi_get_channel</a> (void)</td></tr>
<tr class="memdesc:ga152796dafaf3baffe84e1a45ff05b5e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the channel number for sniffer functions.  <a href="#ga152796dafaf3baffe84e1a45ff05b5e0">More...</a><br /></td></tr>
<tr class="separator:ga152796dafaf3baffe84e1a45ff05b5e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga6e75b0345bab8347d02e421f28801b6c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#ga6e75b0345bab8347d02e421f28801b6c">wifi_set_channel</a> (uint8 channel)</td></tr>
<tr class="memdesc:ga6e75b0345bab8347d02e421f28801b6c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the channel number for sniffer functions.  <a href="#ga6e75b0345bab8347d02e421f28801b6c">More...</a><br /></td></tr>
<tr class="separator:ga6e75b0345bab8347d02e421f28801b6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2cc97dea2fc14040123a9b8fb623d284"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#ga2cc97dea2fc14040123a9b8fb623d284">wifi_promiscuous_set_mac</a> (const uint8_t *address)</td></tr>
<tr class="memdesc:ga2cc97dea2fc14040123a9b8fb623d284"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the MAC address filter for the sniffer mode.  <a href="#ga2cc97dea2fc14040123a9b8fb623d284">More...</a><br /></td></tr>
<tr class="separator:ga2cc97dea2fc14040123a9b8fb623d284"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga39964266988f76d3c08d65820d289410"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__WiFi__Sniffer__APIs.html#ga39964266988f76d3c08d65820d289410">wifi_promiscuous_enable</a> (uint8 promiscuous)</td></tr>
<tr class="memdesc:ga39964266988f76d3c08d65820d289410"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable the promiscuous mode.  <a href="#ga39964266988f76d3c08d65820d289410">More...</a><br /></td></tr>
<tr class="separator:ga39964266988f76d3c08d65820d289410"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>WiFi sniffer APIs. </p>
<h2 class="groupheader">Typedef Documentation</h2>
<a class="anchor" id="gaec780f59bcc8f01c0a4098da86bea999"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void(*  wifi_promiscuous_cb_t) (uint8 *buf, uint16 len)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The RX callback function in the promiscuous mode. </p>
<p>Each time a packet is received, the callback function will be called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>*buf : the data received </td></tr>
    <tr><td class="paramname">uint16</td><td>len : data length</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga152796dafaf3baffe84e1a45ff05b5e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint8 wifi_get_channel </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the channel number for sniffer functions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">null</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>channel number </dd></dl>

</div>
</div>
<a class="anchor" id="ga39964266988f76d3c08d65820d289410"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wifi_promiscuous_enable </td>
          <td>(</td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>promiscuous</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable the promiscuous mode. </p>
<dl class="section attention"><dt>Attention</dt><dd>1. The promiscuous mode can only be enabled in the ESP8266 station mode. Do not call this API in user_init. </dd>
<dd>
2. When in the promiscuous mode, the ESP8266 station and soft-AP are disabled. </dd>
<dd>
3. Call wifi_station_disconnect to disconnect before enabling the promiscuous mode. </dd>
<dd>
4. Don't call any other APIs when in the promiscuous mode. Call wifi_promiscuous_enable(0) to quit sniffer before calling other APIs.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>promiscuous :<ul>
<li>0: to disable the promiscuous mode</li>
<li>1: to enable the promiscuous mode</li>
</ul>
</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
<a class="anchor" id="ga2cc97dea2fc14040123a9b8fb623d284"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_promiscuous_set_mac </td>
          <td>(</td>
          <td class="paramtype">const uint8_t *&#160;</td>
          <td class="paramname"><em>address</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the MAC address filter for the sniffer mode. </p>
<dl class="section attention"><dt>Attention</dt><dd>This filter works only for the current sniffer mode. If users disable and then enable the sniffer mode, and then enable sniffer, they need to set the MAC address filter again.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">const</td><td>uint8_t *address : MAC address</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga6e75b0345bab8347d02e421f28801b6c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool wifi_set_channel </td>
          <td>(</td>
          <td class="paramtype">uint8&#160;</td>
          <td class="paramname"><em>channel</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set the channel number for sniffer functions. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uint8</td><td>channel : channel number</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true : succeed </dd>
<dd>
false : fail </dd></dl>

</div>
</div>
<a class="anchor" id="ga2baed988e772a0ba9107984b4ef5e7a2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wifi_set_promiscuous_rx_cb </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__WiFi__Sniffer__APIs.html#gaec780f59bcc8f01c0a4098da86bea999">wifi_promiscuous_cb_t</a>&#160;</td>
          <td class="paramname"><em>cb</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register the RX callback function in the promiscuous mode. </p>
<p>Each time a packet is received, the registered callback function will be called.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wifi_promiscuous_cb_t</td><td>cb : callback</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>null </dd></dl>

</div>
</div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Mar 1 2016 10:19:26 for ESP8266_RTOS_SDK by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.10
</small></address>
</body>
</html>
